package com.springboot.study.tests.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @Author: guodong
 * @Date: 2021/7/24 10:49
 * @Version: 1.0
 * @Description:
 */
@Documented
@Constraint(validatedBy = {})
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface  EnumValidateAnnotation {

    /**
     * 校验报错信息
     * @return
     */
    String message() default "";

    /**
     * 校验分组
     * @return
     */
    Class<?>[] groups() default {};

    /**
     * 附件 用于扩展
     * @return
     */
    Class<? extends Payload>[] payload() default {};

    /**
     * 允许的枚举值，所有类型转成String 存储
     * @return
     */
    String[] enums() default {};

}